﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <script src="/js/header.js"></script>
    <link href="/lib/sumoselect/sumoselect.css" rel="stylesheet" />
    <link href="/lib/easyui/default/easyui.css" rel="stylesheet" />
    <script type="text/javascript" src="/lib/easyui/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="/lib/sumoselect/jquery.sumoselect.js"></script>
</head>
<body>
    <div class="data-wrap case">
        <div class="data-tool clearfix">
            <div class="pull-left form-inline ">

            </div>
            <div class="pull-right">

                <form class="form-inline" id="formSearch" onsubmit="return false;">

                    <div class="input-group input-group-sm">
                        <div class="input-sm"><input name="autoRefresh" type="checkbox" title="10秒自动刷新" /> <label id="time" class="wd125 gettext">10秒自动刷新</label></div>
                    </div>

                    <div class="input-group input-group-sm">
                        <label class="input-group-addon m5_l gettext">公司名称：</label>
                        <select multiple="multiple" class="search-box-sel-all" name="searchCompanyIds" style="height: 31px;padding: 3px 12px;width:150px;"></select>
                    </div>
                    <div class="input-group input-group-sm">
                        <label class="input-group-addon m5_l gettext">银行名称：</label>
                        <input class="form-control" name="bankName" type="text" autocomplete="off" />
                    </div>
                    <div class="input-group input-group-sm">
                        <label class="input-group-addon m5_l gettext">付款类型：</label>
                        <select class="form-control gettext" name="paymentType">
                            <option value="">请选择</option>
                        </select>
                    </div>
                    <div class="input-group input-group-sm">
                        <label class="input-group-addon m5_l gettext">用户名：</label>
                        <input class="form-control" name="cardName" type="text" autocomplete="off">
                    </div>
                    <div class="input-group input-group-sm">
                        <label class="input-group-addon m5_l gettext">启用状态：</label>
                        <select class="form-control gettext" name="enableStatus">
                            <option value="">请选择</option>
                            <option value="1">启用</option>
                            <option value="2">禁用</option>
                        </select>
                    </div>

                    <div class="input-group input-group-sm">
                        <label class="input-group-addon m5_l gettext">更新时间：</label>
                        <select class="form-control gettext" name="lastUpdateDateSortType">
                            <option value="">请选择</option>
                            <option value="2" selected>不正常</option>
                            <option value="1">正常</option>
                        </select>
                    </div>
                    <button type="button" class="btn btn-default btn-sm active gettext" id="btnSearch">搜索</button>
                    <button type="button" class="btn btn-default btn-sm gettext" id="AdvSearch">高级搜索</button>
                </form>
            </div>
        </div>
        <!--一高级搜索开始-->
        <div class="AdvSearch">
            <div class="AdvSearchcom collapse">
                <table>
                    <tbody>
                        <tr>
                            <td class="gettext">银行卡号：</td>
                            <td><input class="form-control" name="cardNumber" type="text" autocomplete="off"></td>
                            <td class="gettext"></td>
                            <td></td>
                        </tr>
                    </tbody>
                </table>
                <div class="AdvSearchfooter t_c">
                    <button id="search" class="btn btn-default btn-sm gettext" type="button">立即搜索</button>
                    <button id="cancel" data-dismiss="modal" class="btn btn-default btn-sm gettext" type="button">取消</button>
                </div>
            </div>
        </div>
        <div class="data-easyui data-scroll">
            <div class="data-view">
                <div class="data-div-view table-responsive">
                    <table class="table" id="easyui-treegrid"></table>
                </div>
            </div>
        </div>
    </div>

    <script src="/js/page/paymentcard.js?v=201905091034"></script>
    <script type="text/javascript">
        var pageSize = 50;
        var wait = 10;
        var autoRefresh = $("input[name='autoRefresh']");
        var searchCompanyIds = $("select[name='searchCompanyIds']");
    
        $(function () {
            FlashPay.UI.DataAutoHeight();

            $("#btnSearch").click(function () {
                window.currentPage = null;
                doSearch();
            });

            FlashPay.UI.Triggerbox({
                btnAdvSearch: '#AdvSearch',
                searchCallBack: function () {
                    window.currentPage = null;
                    doSearch();
                },
                cancelCallBack: function () {

                }
            });

            FlashPay.UI.DoSearch();

            $(autoRefresh).change(function () {
                wait = 10;
                time();
            });

            var paymentType = $("select[name='paymentType']");
            FlashPay.Util.Ajax({
                type: "POST",
                url: "/SysConfig/GetPaymentTypeList/",
                data: {
                    configCode: "PaymentInterface"
                },
                success: function (response) {
                    if (response.success) {
                        paymentType.empty();
                        if (response.tData != null) {
                            paymentType.append("<option value=\"\">请选择</option>");
                            $.each(response.tData, function (i, item) {
                                 paymentType.append("<option value='" + item.configValue + "'>" + item.configContent + "</option>");
                            });
                            
                        }
                    }
                }
            });
            FlashPay.Util.Ajax({
                type: "POST",
                url: "/Role/GetCompany",
                data: null,
                success: function (response) {
                    if (response.success) {

                        searchCompanyIds.empty();
                        if (response.data != null) {
                            $.each(response.data, function (i, item) {
                                searchCompanyIds.append("<option value='" + item.companyID + "'>" + item.companyName + "</option >");
                            });
                            searchCompanyIds.SumoSelect({ okCancelInMulti: true, selectAll: true });
                        }
                        //cover.Remove();
                    } else {
                        //cover.Remove();
                    }
                },
                error: function (e) {
                    cover.Remove();
                    FlashPay.UI.Tip_short_warning("操作失败！请查看网络，请重试");
                }
            });

            FlashPay.Util.Language();
        });

        //倒时计
        function time() {
            var language = FlashPay.Util.Language();
            var obj = document.getElementById("time");
            var isauto = $(autoRefresh).is(':checked');
            if (!isauto) {
                if (!FlashPay.Util.isNullOrEmptySpance(language) && language == "en") {
                    obj.innerText = "10 Second Refresh";
                } else {
                    obj.innerText = "10 秒自动刷新";
                }
                return false;
            }

            if (wait == 0) {
                if (!FlashPay.Util.isNullOrEmptySpance(language) && language == "en") {
                    obj.innerText = "10 Second Refresh";
                } else {
                    obj.innerText = "10秒自动刷新";
                }

                wait = 10;

                if (isauto) {
                    setTimeout(function () { time(); }, 1000);
                }

                FlashPay.UI.DoSearch();
            } else {
                if (!FlashPay.Util.isNullOrEmptySpance(language) && language == "en") {
                    obj.innerText = wait + " Second Refresh";
                } else {
                    obj.innerText = wait + "秒自动刷新";
                }
                wait--;
                setTimeout(function () { time(); }, 1000);
            }
        }

        $(document).keyup(function (event) {
            var keycode = event.which;
            if (keycode == 13) {
                FlashPay.UI.DoSearch();
            }
        });

        function Tip_success(word) {
            FlashPay.UI.Tip_success(word);
        }
    </script>
</body>
</html>